﻿package client;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.FlowLayout;

import javax.swing.AbstractButton;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.ImageIcon;

import java.awt.Dialog.ModalityType;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;
import java.awt.Toolkit;
import java.awt.Font;
import java.awt.Color;
import java.awt.SystemColor;


public class ResEnterGUI extends JDialog {

	private final JPanel contentPanel = new JPanel();

	/* public static void main(String[] args){
		 EventQueue.invokeLater(new Runnable(){
			 	 
			public void run() {
				try {
					ResEnterGUI frame = new ResEnterGUI();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
});
}*/
	
	public ResEnterGUI() {
		//setFont(new Font("Dialog", Font.PLAIN, 12));
		setTitle("Enter");
		//setModalityType(ModalityType.APPLICATION_MODAL);
		setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
		setIconImage(Toolkit.getDefaultToolkit().getImage(ResEnterGUI.class.getResource("")));
		setBounds(100, 100, 743, 520);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		{
			JButton btnNewButton = new JButton("顾客服务");
			btnNewButton.setForeground(Color.DARK_GRAY);
			btnNewButton.setBackground(SystemColor.controlHighlight);
			btnNewButton.setFont(new Font("方正舒体", Font.PLAIN, 21));
			btnNewButton.setBounds(520, 29, 165, 47);
			btnNewButton.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {

					EventQueue.invokeLater(new Runnable() {
						public void run() {
							try {
								dispose();
								ResCustomServeGUI frame = new ResCustomServeGUI();
								frame.setModal(true);
								frame.setLocationRelativeTo(null);
								frame.setVisible(true);
							} catch (Exception e) {
								e.printStackTrace();
							}
						}
					});
	
			//		dispose();
				}
			});
			contentPanel.setLayout(null);
			btnNewButton.setIcon(new ImageIcon("I:\\eclipse\\Restruant\\src\\player-end.png"));
			contentPanel.add(btnNewButton);
		}
		
		JButton btnNewButton_1 = new JButton("\u5458\u5DE5\u767B\u9646");
		btnNewButton_1.setForeground(new Color(85, 107, 47));
		btnNewButton_1.setBackground(SystemColor.controlHighlight);
		btnNewButton_1.setBounds(600, 446, 117, 26);
		btnNewButton_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
				//frame.setLocationRelativeTo(null);
				ResLoginGUI login=new ResLoginGUI();
				login.setModal(true);
				login.setLocationRelativeTo(null);
				login.setVisible(true);
		//		dispose();
			}
		});
		btnNewButton_1.setIcon(new ImageIcon("I:\\eclipse\\Restruant\\src\\player-end.png"));
		contentPanel.add(btnNewButton_1);
		
		JLabel label = new JLabel("\u6B22\u8FCE\u5149\u4E34~ \u4EB2");
		label.setForeground(new Color(192, 192, 192));
		label.setFont(new Font("幼圆", Font.BOLD, 25));
		label.setBounds(114, 13, 197, 34);
		contentPanel.add(label);
		
		JLabel lblNewLabel = new JLabel("New label");
		lblNewLabel.setBackground(new Color(128, 0, 0));
		lblNewLabel.setIcon(new ImageIcon("src/client/images/2008102410217509_2.jpg"));
		lblNewLabel.setBounds(0, 0, 728, 481);
		contentPanel.add(lblNewLabel);
	}
}





